package com.plian.system.wrapper.pf;

import com.plian.system.dto.pf.BaseLeaderSalaryDetailDTO;
import com.plian.system.entity.pf.BaseLeaderSalaryDetail;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.pf.BaseLeaderSalaryDetailVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * @description: 市属企业负责人薪酬发放表主表
 * @author: gangan
 * @create: 2021-05-12 17:22
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface BaseLeaderSalaryDetailWrapper extends BaseWrapper<BaseLeaderSalaryDetail, BaseLeaderSalaryDetailDTO, BaseLeaderSalaryDetailVO> {

    /**
     * Entity转VO
     *
     * @param entity /
     * @return /
     */
    @Override
    @Mappings(value = {
            @Mapping(source = "fillingUnitId", target = "fillingUnitName", qualifiedByName = ORG_ID_TO_NAME),
            @Mapping(source = "createUser", target = "createUserName", qualifiedByName = USER_ID_TO_NAME),
            @Mapping(source = "updateUser", target = "updateUserName", qualifiedByName = USER_ID_TO_NAME),
            @Mapping(source = "approvedUser", target = "approvedUserName", qualifiedByName = USER_ID_TO_NAME)
    })
    BaseLeaderSalaryDetailVO entityToVO(BaseLeaderSalaryDetail entity);

}
